<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function jisuanqi() {
        var sum = 0;
        while (true) {
          var jiemian = prompt(
            "欢迎使用建议计算器：\n1.加法运算：\n2.减法运算\n3.乘法运算\n4.除法运算\n5.退出：\n请出入您的选项："
          );
          if (jiemian == 5) {
            alert("现在退出系统");

            return;
          }
          var a = +prompt("请输入第一个值");
          var b = +prompt("请输入第二个值");
          if (jiemian == 1) {
            sum = a + b;
            alert("运算结果是：" + sum);
          } else if (jiemian == 2) {
            sum = a - b;
            alert("运算结果是：" + sum);
          } else if (jiemian == 3) {
            sum = a * b;
            alert("运算结果是：" + sum);
          } else if (jiemian == 4) {
            sum = a / b;
            alert("运算结果是：" + sum);
          }
        }
      }
      jisuanqi();
    </script>
  </body>
</html>
